package com.ibbi.admin.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.ibbi.admin.client.front.Perspective;
import com.ibbi.admin.client.session.SessionManager;
import com.ibbi.admin.client.session.login.LoginScreen;

import corelib.client.GwtUtil;
import corelib.client.delegate.CompleteCallback;
import corelib.client.resource.GwtWidgetStyle;
import corelib.client.ui.FontSize;
import corelib.client.ui.SimpleModal;

public class IBBIAdmin implements EntryPoint {

	public void onModuleLoad() {
		GwtUtil.registerUncaughtExceptionLogger();
		FontSize.init();
		SimpleModal.Enabled = true;
		GwtWidgetStyle.ensureInjected();
		RootPanel.get().getElement().getStyle().setBackgroundColor("#fff");
		
		final LoginScreen logInScreen = new LoginScreen();
		SessionManager.init(logInScreen, new CompleteCallback() {
			@Override
			public void onCompleted() {
				logInScreen.hide();
				Perspective.show();
			}
		});
	}
}
